package com.meilai.project.mapper.personnel.org;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meilai.project.dto.personnel.org.RosterListSearchDTO;
import com.meilai.project.entity.personnel.org.Roster;
import com.meilai.project.vo.personnel.org.RosterVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 张驰
 * @date 2022/1/18 9:56
 */
@Mapper
public interface RosterMapper extends BaseMapper<Roster> {
    List<RosterVO> selectPageList(Page<RosterVO> page, @Param("searchDTO") RosterListSearchDTO searchDTO);

    RosterVO getDetailById(@Param("id") Long id);

    List<RosterVO> getListByIds(@Param("ids") List<Long> ids);

    //查询所有正式员工
    List<RosterVO> listRegularList();

    @Select("select * from `roster` where `user_id`= #{user_id}")
    RosterVO selectOneByUserId(@Param("user_id") Long user_id);
}
